import { createApp } from 'vue'
import pinia from './stores'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import './styles/index.scss'
import ElSvg from './components/SvgIcon/ElSvg'
import './permission'


//引入mock接口
import './mock/mockServe'

const app = createApp(App);
//引入全局组件三级分类
import Category from './components/category/category.vue';
//注册为全局组件
app.component("Category",Category);
import { useUserInfoStore } from './stores/userInfo'

//vue-echarts设置
import ECharts from 'vue-echarts'
import { use } from "echarts/core"

// import ECharts modules manually to reduce bundle size
import {CanvasRenderer} from 'echarts/renderers'
import {BarChart} from 'echarts/charts'
import { LineChart } from 'echarts/charts'
import { TitleComponent } from 'echarts/components';
import {
  GridComponent,
  TooltipComponent
} from 'echarts/components'

use([
  CanvasRenderer,
  BarChart,
  LineChart,
  GridComponent,
  TooltipComponent,
  TitleComponent
]);
//全局组件v-chart
app.component('v-chart', ECharts)

ElSvg(app)
app.use(pinia)
  .use(router)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .mount('#app')

